package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	SellFeedbackStatusEventNew           = "erp.SellFeedbackStatusNew"
	SellFeedbackStatusEventBeforeCreate  = "erp.SellFeedbackStatusBeforeCreate"
	SellFeedbackStatusEventBeforeUpdate  = "erp.SellFeedbackStatusBeforeUpdate"
	SellFeedbackStatusEventBeforeSave    = "erp.SellFeedbackStatusBeforeCreate erp.SellFeedbackStatusBeforeUpdate"
	SellFeedbackStatusEventAfterCreate   = "erp.SellFeedbackStatusAfterCreate"
	SellFeedbackStatusEventAfterUpdate   = "erp.SellFeedbackStatusAfterUpdate"
	SellFeedbackStatusEventAfterSave     = "erp.SellFeedbackStatusAfterCreate erp.SellFeedbackStatusAfterUpdate"
	SellFeedbackStatusEventDelete        = "erp.SellFeedbackStatusDelete"
	SellFeedbackStatusAccessControlEvent = "erp.SellFeedbackStatusAccessControl"
)

func GetSellFeedbackStatusConfig() *mgo.DocConfig {
	return SellFeedbackStatus_Config
}

var SellFeedbackStatus_Config *mgo.DocConfig

func init() {
	SellFeedbackStatus_Config = NewSellFeedbackStatusConfig()
}
func NewSellFeedbackStatusConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "erp.SellFeedbackStatus",
		Fields: []string{
			"name", "sort", "l", "r", "level", "link", "parent", "children", "color", "background", "group", "step", "warn",
		},
		RelationFields: []string{
			"parent", "children",
		},
		RelationConfigs: map[string]*mgo.DocRelation{
			"parent": {
				Config:     GetSellFeedbackStatusConfig,
				DocName:    "SellFeedbackStatus",
				JoinType:   "O",
				KeyInside:  "parentId",
				KeyOutSide: "id",
			},
			"children": {
				Config:     GetSellFeedbackStatusConfig,
				DocName:    "SellFeedbackStatus",
				JoinType:   "M",
				KeyInside:  "id",
				KeyOutSide: "parentId",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
